from peewee import *

db = MySQLDatabase("lagou", host="127.0.0.1", port=3306, user="root", password="Ys19960216/")

class BaseModel(Model):
    class Meta:
        database = db

class Topic(BaseModel):
    id = IntegerField(primary_key=True, null=True)
    positionID = IntegerField(null=True)
    longitude = FloatField(null=True)
    latitude = FloatField(null=True)
    positionName = CharField(max_length=50, null=False)
    workYears = CharField(max_length=20, null=False)
    education = CharField(max_length=20, null=False)
    jobNature = CharField(max_length=20, null=True)
    financeStage = CharField(max_length=30, null=True)
    companySize = CharField(max_length=30, null=True)
    industryFiled = CharField(max_length=30, null=True)
    city = CharField(max_length=10, null=False)
    positionAdvantage = CharField(max_length=200, null=True)
    companyShortName = CharField(max_length=50, null=True)
    companyFullName = CharField(max_length=200, null=True)
    district = CharField(max_length=20, null=True)
    companyLabelList = CharField(max_length=200, null=True)
    salary = CharField(max_length=20, null=False)
    crawl_date = CharField(max_length=20, null=False)

if __name__ == '__main__':
    db.create_tables([Topic])
